﻿<%@ Page CodeFileBaseClass="AliCMS.Lib.MultiUserAdminPageBase" %>
<ali:Get ID="Menu" Object="Menu" InnerID="Request.QueryString['ID']" Validate="True" />
<ali:Get ID="Config" Object="InstanceConfig" Operation="GetBasicSettings()" />
<ali:List ID="SubSite" Object="Site" Condition="SubInstanceID=Menu[SubInstanceID]" />
<section data-page="menu_edit" data-title="编辑菜单" data-id="<%=Menu[InnerID]%>" data-parent-id="<%=Menu[ParentID]%>" data-page-template="<%=Menu[PageTemplate]%>" data-site-domain="<%=Site[Domain]%>" data-sub-site-domain="<%=SubSite[Domain]%>" data-web-path="<%=Config[ActualUrl].Replace("{#PageID#}", Convert.ToString(SubSite[PageID]))%>">
	<div class="path1"><span>您的位置：</span><a href="list.aspx" target="ali-navtab">菜单列表</a> → <b class="<%=ContentLang%>Font"><%=Menu[Name]%></b></div>
	<form action="" class="post">
		<div class="post-body">
			<table class="post-table">
				<tr>
					<th>名称：</th>
					<td><input type="text" name="Name" value="<%=Menu[Name]%>" size="50" maxlength="255" class="ali-input ali-input-required <%=ContentLang%>Font"></td>
				</tr>
				<tr>
					<th>类别：</th>
					<td>
						<select name="CategoryID" class="<%=ContentLang%>Font" data-ali-widget="combo" data-tree="true" data-root="0">
							<option value="" data-item="" data-parent="0">未指定</option>
							<ali:Tree Object="MenuCategory" Validate="True">
								<ali:Record>
									<%If Convert.ToString(ID) == Menu[CategoryID]%>
										<option value="<%=ID%>" data-item="<%=ParentChain%>.<%=InnerID%>" data-parent="<%=ParentChain%>" selected><%=Name%></option>
									<%Else%>
										<option value="<%=ID%>" data-item="<%=ParentChain%>.<%=InnerID%>" data-parent="<%=ParentChain%>"><%=Name%></option>
									<%EndIf%>
									<%=ChildRecords%>
								</ali:Record>
							</ali:Tree>
						</select>
					</td>
				</tr>
				<tr>
					<th>上级：</th>
					<td>
						<select name="ParentID" class="<%=ContentLang%>Font" data-ali-widget="combo" data-tree="true" data-root="0">
							<option value="" data-item="" data-parent="0">未指定</option>
						</select>
					</td>
				</tr>
				<tr>
					<th>图片：</th>
					<td>
						<input type="text" name="Picture" value="<%=Menu[Picture]%>" size="55" class="ali-input">
						<a class="ali-button ali-uploader">浏览...</a>
						<input type="hidden" name="PictureAllowedType" value="gif|jpg|jpeg|png|bmp">
					</td>
				</tr>
				<tr>
					<th>类型：</th>
					<td>
						<%If Convert.ToString(Menu[Type]) == 'Content'%>
							<label><input type="radio" name="Type" value="Content" checked>内容</label>
							<label><input type="radio" name="Type" value="InnerLink">内链</label>
							<label><input type="radio" name="Type" value="OuterLink">外链</label>
						<%ElseIf Convert.ToString(Menu[Type]) == 'InnerLink'%>
							<label><input type="radio" name="Type" value="Content">内容</label>
							<label><input type="radio" name="Type" value="InnerLink" checked>内链</label>
							<label><input type="radio" name="Type" value="OuterLink">外链</label>
						<%Else%>
							<label><input type="radio" name="Type" value="Content">内容</label>
							<label><input type="radio" name="Type" value="InnerLink">内链</label>
							<label><input type="radio" name="Type" value="OuterLink" checked>外链</label>
						<%EndIf%>
					</td>
				</tr>
				<tr>
					<th>网址：</th>
					<td>
						<select name="ChannelID" class="<%=ContentLang%>Font" data-ali-widget="combo" data-tree="true" data-root="0">
							<ali:Tree Object="Channel">
								<ali:Record>
									<%If Convert.ToString(ID) == Menu[CategoryID]%>
										<option value="<%=ID%>" data-path="<%=Path%>" data-template-path="<%=TemplatePath%>" data-item="<%=ParentChain%>.<%=InnerID%>" data-parent="<%=ParentChain%>" selected><%=Name%></option>
									<%Else%>
										<option value="<%=ID%>" data-path="<%=Path%>" data-template-path="<%=TemplatePath%>" data-item="<%=ParentChain%>.<%=InnerID%>" data-parent="<%=ParentChain%>"><%=Name%></option>
									<%EndIf%>
									<%=ChildRecords%>
								</ali:Record>
							</ali:Tree>
						</select>
						<select name="PageTemplate" data-ali-widget="combo"></select>
						<input type="text" name="Path" value="<%=Menu[Path]%>" size="60" maxlength="255" class="ali-input" style="display:none">
						<div>最终结果：<span data-id="url"></span></div>
					</td>
				</tr>
				<tr>
					<th>内容：</th>
					<td>
						<textarea name="Content" data-lang="<%=ContentLang%>" data-instance-id="<%=InstanceID%>" class="editor"><%=HttpUtility.HtmlEncode(Menu[Content].ToString())%></textarea>
					</td>
				</tr>
				<tr>
					<th>是否显示：</th>
					<td>
						<%If Convert.ToBoolean(Menu[IsDisplay])%>
							<label><input type="radio" name="IsDisplay" checked>是</label>
							<label><input type="radio" name="IsDisplay">否</label>
						<%Else%>
							<label><input type="radio" name="IsDisplay">是</label>
							<label><input type="radio" name="IsDisplay" checked>否</label>
						<%EndIf%>
					</td>
				</tr>
			</table>
		</div>
		<div class="post-footer"><button type="submit" class="ali-button">保 存</button></div>
	</form>
</section>